package com.dayaokeji.rhythmschoolstudent.utils;

/**
 * @author Colin Chen
 */

public class ObjectUtils {

    public static <T> String toString(T object, T defaultValue) {
        return object == null || object == "" ? defaultValue.toString() : object.toString();
    }

    public static <T> T ifNull(T object, T defaultValue) {
        return object == null ? defaultValue : object;
    }

    public static boolean equals(Object a, Object b) {
        return (a == null) ? (b == null) : a.equals(b);
    }
}
